<template>
  <a-card :bordered="false" :class="{'abcdefg':true}">
    <div class="no-print" style="text-align: right">
      <a-button v-print="'#printContent'" ghost type="primary">打印</a-button>
    </div>
    <section ref="print" id="printContent" class="abcdefg">
      <!-- <iframe src="http://192.168.3.165:38080/jeecg-boot/bfjy5s/gkakCsSmlJianKangFengXian/getFile" width="100%" height="1600px" scrolling="no" marginheight="0" marginwidth="0"></iframe> -->
      <!-- <iframe id="ifm1" runat="server" src="http://192.168.3.165:38080/jeecg-boot/bfjy5s/gkakCsSmlJianKangFengXian/getFile" width="100%" height="100%"  frameborder="0" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="no" ></iframe> -->
      <!-- <iframe src="http://192.168.3.165:38080/jeecg-boot/bfjy5s/gkakCsSmlJianKangFengXian/getFile" id="currentFrame" width="100%" scrolling="no" frameborder="no"></iframe> -->
      <iframe style="border: 1px solid #F00;" :src="bdTokenUrl" frameborder="0" scrolling="no" width="860px" marginheight="0" marginwidth="0" height="1600px" id="bdIframe"></iframe>
    </section>
  </a-card>
  <!--</page-layout>-->
</template>
<script>
  import ACol from "ant-design-vue/es/grid/Col";
  import ARow from "ant-design-vue/es/grid/Row";
  import ATextarea from 'ant-design-vue/es/input/TextArea'

  export default {
    components: {
      ATextarea,
      ARow,
      ACol,
    },
    name: 'Printgzsld',
    props:{
      reBizCode:{
        type: String,
        default: ''
      }
    },
    data(){
      return {
        bdTokenUrl : 'http://192.168.3.165:38080/jeecg-boot/bfjy5s/gkakCsSmlJianKangFengXian/getFile',
        columns: [{
        }
        ],
        labelCol: {
          xs: { span: 24 },
          sm: { span: 2 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 8 },
        },
        printer:'张三',
        printTime:'2019-02-01 12:00:00',
        printContent:'打印内容就是,做一个打印测试',
        printReason:'做一个打印测试',
        previewVisible: false,
        previewImage: '',
        fileList: [{
          uid: '-1',
          name: 'xxx.png',
          status: 'done',
          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
        },
          {
            uid:'-2',
            name:'pic1.png',
            status:'done',
            url:'https://www.gizbot.com/img/2016/11/whatsapp-error-lead-image-08-1478607387.jpg',
          }
        ],
        url:{
          loadApplicant:"/sps/register/loadApplicants",
          loadRegisterFiles:"/sps/register/getRegisterFilesConfig",
        }
      }
    },
    created() {
    },
    mounted(){
      /**
       * iframe-宽高自适应显示
       */
      setTimeout(function(){
        const oIframe = document.getElementById('bdIframe');
        const deviceHeight = document.documentElement.clientHeight;
        oIframe.style.height = (Number(deviceHeight)+120) + 'px'; //数字是页面布局高度差

        // const oIframe = document.getElementById('bdIframe');
        // const deviceWidth = document.documentElement.clientWidth;
        // const deviceHeight = document.documentElement.clientHeight;
        // oIframe.style.width = (Number(deviceWidth)-220) + 'px'; //数字是页面布局宽度差值
        // oIframe.style.height = (Number(deviceHeight)-120) + 'px'; //数字是页面布局高度差
      }, 1000);
    },
    methods: {
      loadData(){

      },
      getDate(){
        var iframeObj = document.getElementById("currentFrame").contentWindow;//获取iframe引入网页的window对象,进而通过window对象获取引入内容的document对象
    　　　if(iframeObj.document.body){
            document.getElementById("currentFrame").height = iframeObj.document.body.scrollHeight;
          }
      },
      handleCancel () {
        this.previewVisible = false
      },
      handlePreview (file) {
        this.previewImage = file.url || file.thumbUrl
        this.previewVisible = true
      },
      handleChange ({ fileList }) {
        this.fileList = fileList
      }
    }
  }
</script>
<style scoped>
  /*update_begin author:scott date:20191203 for:打印机打印的字体模糊问题 */
  * {
    color: #000000!important;
    -webkit-tap-highlight-color: #000000!important;
  }
  /*update_end author:scott date:20191203 for:打印机打印的字体模糊问题 */

  .abcdefg .ant-card-body{
    margin-left: 0%;
    margin-right: 0%;
    margin-bottom: 1%;
    border:0px solid black;
    min-width: 800px;
    color:#000000!important;
  }
  .explain{
    text-align: left;
    margin-left: 50px;
    color:#000000!important;
  }
  .explain .ant-input,.sign .ant-input{
    font-weight:bolder;
    text-align:center;
    border-left-width:0px!important;
    border-top-width:0px!important;
    border-right-width:0px!important;
  }
  .explain div{
    margin-bottom: 10px;
  }
  /* you can make up upload button and sample style by using stylesheets */
  .ant-upload-select-picture-card i {
    font-size: 32px;
    color: #999;
  }

  .ant-upload-select-picture-card .ant-upload-text {
    margin-top: 8px;
    color: #666;
  }
</style>